package com.yubest.demo.service.impl;

import com.yubest.demo.service.JsonStrategy;

/**
 * 限制长度
 * @author huangweiyu
 * @version V1.0
 * @date 21:49
 **/
public class LimitJsonStrategy implements JsonStrategy {

    @Override
    public Object to(Object value) {
        String v = (String) value;
        return v.length() > 10 ? v.substring(0, 10) + "..." : v;
    }
}
